<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico"/>
<title>DynamoRIO API: _dr_syscall_result_info_t Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">DynamoRIO API
   </div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('struct__dr__syscall__result__info__t.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-attribs">Data Fields</a>  </div>
  <div class="headertitle">
<div class="title">_dr_syscall_result_info_t Struct Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;dr_tools.h&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:ab8762d7cd2453f6f306ee23420a9d0bd"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct__dr__syscall__result__info__t.html#ab8762d7cd2453f6f306ee23420a9d0bd">size</a></td></tr>
<tr class="memitem:a3865013d8cf81ac4543f02ac458de866"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct__dr__syscall__result__info__t.html#a3865013d8cf81ac4543f02ac458de866">succeeded</a></td></tr>
<tr class="memitem:a4f3fef7d8e374b0ba9f0926d8e8fa3ec"><td class="memItemLeft" align="right" valign="top">reg_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct__dr__syscall__result__info__t.html#a4f3fef7d8e374b0ba9f0926d8e8fa3ec">value</a></td></tr>
<tr class="memitem:ac48039fe12a1261d673b0a073bb7b636"><td class="memItemLeft" align="right" valign="top">reg_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct__dr__syscall__result__info__t.html#ac48039fe12a1261d673b0a073bb7b636">high</a></td></tr>
<tr class="memitem:a640d68c87a33d04d70f5680c845c5eae"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct__dr__syscall__result__info__t.html#a640d68c87a33d04d70f5680c845c5eae">use_high</a></td></tr>
<tr class="memitem:a08c70526e7a3c63954234021129c1a90"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct__dr__syscall__result__info__t.html#a08c70526e7a3c63954234021129c1a90">use_errno</a></td></tr>
<tr class="memitem:abf54b7a452b011912d6b7bbba7b84a20"><td class="memItemLeft" align="right" valign="top">uint&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct__dr__syscall__result__info__t.html#abf54b7a452b011912d6b7bbba7b84a20">errno_value</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Data structure used to obtain or modify the result of an application system call by <a class="el" href="dr__tools_8h.html#a0e4cf94bfc4dca2deb04699c28a56e55">dr_syscall_get_result_ex()</a> and <a class="el" href="dr__tools_8h.html#aaae7ca4aa76652ddaaacb1e8dad9f6af">dr_syscall_set_result_ex()</a>. </p>
</div><hr/><h2>Field Documentation</h2>
<a class="anchor" id="abf54b7a452b011912d6b7bbba7b84a20"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint _dr_syscall_result_info_t::errno_value</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>If requested by <code>use_errno</code>, if a system call fails (i.e., <code>succeeded</code> is false) <a class="el" href="dr__tools_8h.html#a0e4cf94bfc4dca2deb04699c28a56e55">dr_syscall_get_result_ex()</a> will set this field to the absolute value of the error code returned (i.e., on Linux, it will be inverted from what the kernel directly returns, in order to facilitate cross-platform clients that operate on both Linux and MacOS). For Linux and Macos, when <code>succeeded</code> is true, <code>errno_value</code> is set to 0.</p>
<p>If <code>use_errno</code> is set for <a class="el" href="dr__tools_8h.html#aaae7ca4aa76652ddaaacb1e8dad9f6af">dr_syscall_set_result_ex()</a>, then this value will be stored as the system call's return value, negated if necessary for the underlying platform. In that case, <code>value</code> will be ignored. </p>

</div>
</div>
<a class="anchor" id="ac48039fe12a1261d673b0a073bb7b636"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">reg_t _dr_syscall_result_info_t::high</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>On some platforms (such as MacOS), a 32-bit application's system call can return a 64-bit value. For such calls, this field will hold the top 32 bit bits, if requested by <code>use_high</code>. It is up to the caller to know which system calls have 64-bit return values. System calls that return only 32-bit values do not clear the upper bits. Consider using the "drsyscall" Extension in order to obtain per-system-call semantic information, including return type. </p>

</div>
</div>
<a class="anchor" id="ab8762d7cd2453f6f306ee23420a9d0bd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t _dr_syscall_result_info_t::size</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The caller should set this to the size of the structure. </p>

</div>
</div>
<a class="anchor" id="a3865013d8cf81ac4543f02ac458de866"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool _dr_syscall_result_info_t::succeeded</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Indicates whether the system call succeeded or failed. For <a class="el" href="dr__tools_8h.html#aaae7ca4aa76652ddaaacb1e8dad9f6af">dr_syscall_set_result_ex()</a>, this requests that DR set any additional machine state, if any, used by the particular plaform that is not part of <code>value</code> to indicate success or failure (e.g., on MacOS the carry flag is used to indicate success).</p>
<p>For Windows, the success result from <a class="el" href="dr__tools_8h.html#a0e4cf94bfc4dca2deb04699c28a56e55">dr_syscall_get_result_ex()</a> should only be relied upon for ntoskrnl system calls. For other Windows system calls (such as win32k.sys graphical (NtGdi) or user (NtUser) system calls), computing success depends on each particular call semantics and is beyond the scope of this routine (consider using the "drsyscall" Extension instead).</p>
<p>For Mach syscalls on MacOS, the success result from <a class="el" href="dr__tools_8h.html#a0e4cf94bfc4dca2deb04699c28a56e55">dr_syscall_get_result_ex()</a> should not be relied upon. Computing success depends on each particular call semantics and is beyond the scope of this routine (consider using the "drsyscall" Extension instead). </p>

</div>
</div>
<a class="anchor" id="a08c70526e7a3c63954234021129c1a90"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool _dr_syscall_result_info_t::use_errno</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This should be set by the caller. For <a class="el" href="dr__tools_8h.html#a0e4cf94bfc4dca2deb04699c28a56e55">dr_syscall_get_result_ex()</a>, this requests that DR fill in the <code>errno_value</code> field. For <a class="el" href="dr__tools_8h.html#aaae7ca4aa76652ddaaacb1e8dad9f6af">dr_syscall_set_result_ex()</a>, this requests that DR set the <code>value</code> to indicate the particular error code in <code>errno_value</code>. </p>

</div>
</div>
<a class="anchor" id="a640d68c87a33d04d70f5680c845c5eae"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool _dr_syscall_result_info_t::use_high</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This should be set by the caller, and only applies to 32-bit system calls. For <a class="el" href="dr__tools_8h.html#a0e4cf94bfc4dca2deb04699c28a56e55">dr_syscall_get_result_ex()</a>, this requests that DR fill in the <code>high</code> field. For <a class="el" href="dr__tools_8h.html#aaae7ca4aa76652ddaaacb1e8dad9f6af">dr_syscall_set_result_ex()</a>, this requests that DR set the high 32 bits of the application-facing result to the value in the <code>high</code> field. </p>

</div>
</div>
<a class="anchor" id="a4f3fef7d8e374b0ba9f0926d8e8fa3ec"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">reg_t _dr_syscall_result_info_t::value</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The raw main value returned by the system call. See also the <code>high</code> field. </p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="dr__tools_8h.html">dr_tools.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="struct__dr__syscall__result__info__t.html">_dr_syscall_result_info_t</a></li>
    <li class="footer" style="float:none;text-align:center"><img border=0 src="favicon.png"> &nbsp;  DynamoRIO API version 5.0.0 --- Wed Sep 10 2014 21:36:44 &nbsp; <img border=0 src="favicon.png">
</small></address>
<!--END !GENERATE_TREEVIEW-->
</body>
</html>
